<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <input type="button" value="开始">
    <script>
        let elm=document.querySelector('input')
        elm.onclick=function()
        {
            if(elm.value=="开始")
                elm.value="stop"
            else
                elm.value="开始"
        }
    </script> -->
    <input type="text" value="0">
    <button id="add">+</button>
    <button id="sub">-</button>
    <script>
        let text=document.querySelector("input")
        let btn_add=document.querySelector('#add')
        let btn_sub=document.querySelector('#sub')
        btn_add.onclick=function()
        {
            let sum=parseInt(text.value)+1;
            text.value=sum;
        }
        btn_sub.onclick=function()
        {
            let sum=parseInt(text.value)-1;
            text.value=sum;
        }
    </script>

</body>
</html>